package com.qire.common.function;

import java.util.Objects;

@FunctionalInterface
public interface Action {

    void call();

    default Action compose(Action before) {
        Objects.requireNonNull(before);
        return () -> {before.call(); call();};
    }

    default Action andThen(Action after) {
        Objects.requireNonNull(after);
        return () -> {call(); after.call();};
    }

}
